import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';

import { ApiHideProperty, ApiProperty } from "@nestjs/swagger";

@Entity({ name: 'delivery_address' })
export class DeliveryAddressEntity {

    @PrimaryGeneratedColumn()
    @ApiProperty({ description: '主键' })
    id: number

    @Column()
    @ApiProperty({ description: '省编码' })
    provinceCode: string

    @Column()
    @ApiProperty({ description: '省名字' })
    provinceName: string

    @Column()
    @ApiProperty({ description: '市编码' })
    cityCode: string

    @Column()
    @ApiProperty({ description: '市名字' })
    cityName: string

    @Column()
    @ApiProperty({ description: '区编码' })
    districtCode: string

    @Column()
    @ApiProperty({ description: '区名字' })
    districtName: string

    @Column()
    @ApiProperty({ description: '县编码' })
    countyCode: string

    @Column()
    @ApiProperty({ description: '县名字' })
    countyName: string

    @Column()
    @ApiProperty({ description: '详细地址' })
    detailAddress: string

    @Column()
    @ApiProperty({ description: '用户id' })
    userId: number

    @Column()
    @ApiProperty({ description: '是否是默认地址：0 否 1 是' })
    isDefault: number

    @Column()
    @ApiProperty({ description: '收货人姓名' })
    receiverName: string

    @Column()
    @ApiProperty({ description: '收货人电话' })
    receiverMobile: string

    @CreateDateColumn()
    // @ApiProperty({ description: '创建时间' })
    @ApiHideProperty()
    createdTime: Date

    @UpdateDateColumn()
    // @ApiProperty({ description: '更新时间' })
    @ApiHideProperty()
    updatedTime: Date

}